package com.mega.fe.util.klass;

import com.mega.fe.util.MEGA;

import java.lang.instrument.Instrumentation;
import java.lang.invoke.VarHandle;

@Deprecated
public class McInstGetter {
    public static Class<?> TRUE_INST_MANAGER;
    static {
        try {
            TRUE_INST_MANAGER = MEGA.DefineClassLoader.APP_LOADER.loadClass("com.mega.fe.util.klass.InstManager");
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
    public static Instrumentation i() {
        VarHandle varHandle;
        try {

            varHandle = MEGA.IMPL_LOOKUP().findStaticVarHandle(TRUE_INST_MANAGER, "inst", Instrumentation.class);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
        return (Instrumentation) varHandle.get();
    }
}
